package com.helint.component.encryption.config;

import com.helint.component.encryption.filter.EnDecryptionFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author junjunhuang
 * @version 1.0.0
 * @date 2024/01/25 10:55
 */
@Configuration
public class EncryptionConfig {
    /**
     * 过滤器配置
     */
    @Bean
    public FilterRegistrationBean<EnDecryptionFilter> filterRegistration(EnDecryptionFilter filter) {
        FilterRegistrationBean<EnDecryptionFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(filter);
//        registration.addUrlPatterns("/**");
        registration.setName("encryptionFilter");
        //设置优先级别
        registration.setOrder(1);
        return registration;
    }
}